#include <iostream>
using namespace std;

const char digit[]="0123456789";

char* itoa(int i,char b[])
{
    char* p1 = b;
    for( ; i > 0; i = i/10)
    {
        *p1++ = digit[i%10];
    }
    *p1-- = '\0';
    char* p2 = b;
    int step = ( p1-p2 )/2;
    while(step-- >= 0)
    {
        char temp = *p2;
        *p2 = *p1;
        *p1 = temp;
        p2++;
        p1--;
    }
    return b;
}
int main()
{
    char buffer[1024];
    while(true){
        int i;
        cout << "Please input a integer";
        cin >> i;
        cout << itoa(i,buffer)<< endl;
    }
    return 0;
}
